package cate.common.table.trademall.luxuryshop;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "交易坊-珍宝商铺通用配置 Row")
public class LuxuryShopCommonRow extends ERow {
    @NoteField(value = "开启类型", detail = "1开服天数开启 2实际日期开启")
    public int openType;
    @NoteField(value = "开服天数开启")
    public int openDay;
    @NoteField(value = "实际日期开启")
    public String openDateStr;
    @NoteField(value = "持续天数", detail = "0永久开启")
    public int duration;
    @NoteField(value = "循环天数")
    public int round_duration;
    @NoteField(value = "循环次数")
    public int round_times;
    @NoteField(value = "邮件ID")
    public int mailId;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        id = xrw.getInteger("ID");
        openType = xrw.getInteger("开启类型");
        openDay = xrw.getInteger("开服天数开启", 0);
        openDateStr = xrw.getString("实际日期开启", "");
        duration = xrw.getInteger("持续天数", 0);
        round_duration = xrw.getInteger("循环天数", 0);
        if (round_duration > 0 && round_duration < duration) {
            getContext().warningOnSheetLoading(parent.getSheetName(), "ID=" + id + " 循环天数小于持续天数！");
        }
        round_times = xrw.getInteger("循环次数", 1);
        mailId = xrw.getInteger("邮件ID", 0);
    }
}
